#include <stdio.h>

size_t mystrlen(const char *s){
    const char *p = s;
    while (*p!= '\0') {
        p++;
    }
    return p - s;
}

char *mystrcpy(char *dest, const char *src){
    while (*src != '\0') {
        *dest = *src;
        dest++;
        src++;
    }
    *dest = '\0'; 
    return dest;
}

char *mystrcat(char *dest, const char *src){
    while (*dest != '\0') {
        dest++;
    }
    while (*src != '\0') {
        *dest = *src;
        dest++;
        src++;
    }
    *dest = '\0'; 
    return dest;
}

int main() {
    char str1[100] = "str1";
    char str2[100] = "str2";
    char str3[100] = "str3";
    printf("mystrlen(str1): %d\n", mystrlen(str1));
    mystrcpy(str1, str2);
    printf("mystrcpy(str1, str2): %s\n", str1);
    mystrcat(str2, str3);
    printf("mystrcat(str2, str3): %s\n", str2);
    return 0;
}

